package au.com.introprogexercise.core.excercises;

/**
 * Created by olga on 31/05/14.
 */
public class FizzBuzzExercise
{
    public static boolean isDivisible(int number, int dividor)
    {
        return number % dividor == 0;
    }

    public static void fizzBuzz()
    {
        for( int i = 1; i <= 100; i++ )
        {
            if( isDivisible(i, 3) )
            {
                if( isDivisible(i, 5))
                {
                    System.out.println("FizzBuzz");
                }
                else
                {
                    System.out.println("Fizz");
                }
            }
            else if ( isDivisible(i, 5) )
            {
                System.out.println("Buzz");
            }
            else
            {
                System.out.println(i);
            }
        }
    }
}
